package com.htthorizon.neo4j.repository;

import com.htthorizon.neo4j.entity.RelationShip2;
import com.htthorizon.neo4j.entity.RelationShip3;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RelationShip3Repository extends Neo4jRepository<RelationShip3, Long> {
    @Query("MATCH (f:Field)<-[r:R3]-(m:Model) WHERE id(m) = $id RETURN f ,r,m")
    List<RelationShip3> getById(@Param("id")Long id);
    @Query("MATCH p=(a:Model)-[r:R3]->(b:Field) Where id(b)= $id  RETURN a,r,b")
    List<RelationShip3> findByBdId(@Param("id")Long id);
}
